package com.fastCms.business.frame.plugins.sms;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

@Slf4j
@Service
public class SmsManager {
    private static Map<String, ISmsStrategy> handlerMap = new ConcurrentHashMap<>();

    private SmsManager() {
        super();
    }

    public static ISmsStrategy getHandler(String strategyCode) {
        return handlerMap.get(strategyCode);
    }

    public static void setHandler(String strategyCode, ISmsStrategy handler) {
        handlerMap.put(strategyCode, handler);
    }
}
